import React from 'react'
// 引入Route组件
import { Route, Link, Switch, Redirect } from 'react-router-dom'
import Home from './pages/Home'
import Detail from './pages/Detail'
export default function App() {
  return (
    <div>
      <Link to="/home">首页</Link>
      <Link to="/detail">详情页</Link>

      <Switch>
        <Redirect from="/xxx" to="/home"></Redirect>
        <Route path="/home" component={Home}></Route>
        <Route path="/detail" component={Detail}></Route>
      </Switch>
    </div>
  )
}
